Project ID | FD17E29641C6117580258994003AF3B0 |
Version | 3 |
Class ID | 881D17BDD6F1A9D58025899600497486 |
Class Type | Base |
Attributes |
%REM
The following code filters out values that are odd numbers
%END REM
Class EvenFilter as MapFilter
Function filter(kvPair as Pair) as Boolean
Dim value as Integer
value = kvPair.value
Return value Mod 2 = 0
End Function
End Class
Dim map as New Map("INTEGER", Nothing, False)
Dim ef as New EvenFilter
Dim map2 as Map
Call map.put("Elem1", 1)
Call map.put("Elem2", 2)
Call map.put("Elem3", 3)
Call map.put("Elem4", 4)
Set map2 = map.filter(ef)
Print map2.elementCount
Copyright © HCL America, Inc. 1999, 2023. All Rights Reserved.